<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理</title>
    {%include 'admin/csbase.html'%}
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox">
            <div class="ibox-content">
                <form id="search" method="get" class="form-inline">
                    <div class="row m-t">
                        <div class="col-sm-12">
                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-white" title="搜索">
                                    <i class="fa fa-search"></i>
                                </button>
                                <button type="button" class="btn btn-white" title="刷新" onclick="window.location.reload();">
                                    <i class="fa fa-repeat"></i>
                                </button>
                            </div>
                            <div class="pull-right">
                                <input type="text" name="username" id="username" value="{$_GET['username']}" class="form-control" placeholder="会员帐号" />
                                <select name="htype" class="form-control">
                                    <option value="">请选择类型</option>
                                    <volist name="type" id="vo">
                                    <option value="{$key}" <if condition="$key eq $_GET['type']">selected</if>>{$vo.name}</option>
                                    </volist>
                                </select>
                                <input type="text" name="addtime" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" value="{$_GET['addtime']}"   class="form-control" placeholder="时间" readonly />
                                &nbsp;
                            </div>
                        </div>
                    </div>
                </form>
                <div class="table-responsive m-t-sm">
                    <table class="{$Think.config.TABLE_CLASS}">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>二维码</th>
                                <th>帐号/姓名/类型/地址/状态</th>
                                <th>金额(币)</th>
                                <th>手续费(币)</th>
                                <th>实发(币)</th>
                                <th>申请时间</th>
                                <th>审核时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <empty name="list">
                            <tr>
                                <td colspan="11" style="text-align:center">暂无数据！</td>
                            </tr>
                            <else />
                            <volist name="list" id="vo">
                            <tr>
                                <td>{$vo.id}</td>
                                <td><img src="{$vo['qrcode']}" link="{$vo['qrcode']}" width="120"></td>
                                <td>
                                    <p>{$vo.uid|getuser="username"}</p>
                                    <p>{$vo.uid|getuser="truename"}</p>
                                    <p>{$vo.wtype|getbonustype="name"}</p>
                                    <p>{$vo.note}</p>
                                    <if condition="$vo['status'] eq 0">
                                    <p>审核中</p>
                                <elseif condition="$vo['status'] eq 1" />
                                    <p>已拒绝</p>
                                <elseif condition="$vo['status'] eq 2" />
                                    <p>已完成</p>
                                </if>
                                </td>
                                <td>{$vo.amount}</td>
                                <td>{$vo.tax}</td>
                                <td>{$vo['amount']-$vo['tax']}</td>
                                <td>{$vo.addtime|date="Y/m/d H:i:s",###}</td>
                                <td><if condition="$vo['updatetime'] gt 0">
                                    {$vo.updatetime|date="Y/m/d H:i:s",###}
                                </if></td>
                                <td><if condition="$vo['status'] eq 0">
                                    <a link="{:U('Cash/withpass',array('id'=>$vo['id']))}" class="btn btn-xs btn-success pass">通过</a>
                                    <br />
                                    <a link="{:U('Cash/withrefuse',array('id'=>$vo['id']))}" class="btn btn-xs btn-danger refuse">拒绝</a>
                                </if></td>
                            </tr>
                            </volist>
                            </empty>
                        </tbody>
                    </table>
                    <div id="page"></div>
                </div>
            </div>
        </div>
    </div>
    
    {%include 'admin/jsbase.html'%}
    <script type="text/javascript">
    $(document).ready(function() {
        $("#page").pager({
            pagenumber: {$p},
            pagecount: {$pagesize},
            buttonClickCallback: PageClick
        });
        
        $(".pass").click(function(){
            var url = $(this).attr("link");
            layer.confirm('你确定要通过审核操作吗？',{title:'操作提示'}, function(index){
                sc.ajaxreturn(url,{});
            });
        });
        
        $(".refuse").click(function(){
            var url = $(this).attr("link");
            layer.confirm('你确定要拒绝提现吗？币将自动返回到提现账户',{title:'操作提示'}, function(index){
                sc.ajaxreturn(url,{});
            });
        });
        
        $("img").click(function(){
            var imgsrc = $(this).attr("link");
            layer.open({
                type: 1,
                skin: 'layui-layer-rim', //加上边框
                area: ['50%', '90%'], //宽高
                content: '<img src="'+ imgsrc +'" width="100%">'
            });
        });
    });

    PageClick = function(p) {
        sc.pageurl('','p',p);
    }
    </script>
</body>
</html>